
<template>
    <div>
        <router-link to="/TestRecord" style="float: right">
            <el-button type="danger" icon="close" size="mini" class="bolder outsideBtnBS"></el-button>
        </router-link>
        <label class="default-label" v-text="nowLangue.JudgeTestRecord"><!--检验判定--></label>
        <el-button type="danger" size="mini" :disabled="selectDisabled" class="bolder outsideBtnBS selectAll" v-text="nowLangue.confirm"><!--确定--></el-button>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <p>
                <!-- 备件编码-->
                <el-form-item :label="nowLangue.spareCode" class="selectMB10">
                    <el-input size="mini" disabled v-model="formInline.materialCode"></el-input>
                </el-form-item>
                <!-- 备件名称-->
                <el-form-item :label="nowLangue.spareName" class="selectMB10">
                    <el-input size="mini" disabled v-model="formInline.materialName"></el-input>
                </el-form-item>
            </p>
            <!-- 检验项目-->
            <p class="radioLine">
                <el-form-item :label="nowLangue.testProject" class="selectMB10">
                    <el-radio-group v-model="formInline.testProject">
                        <el-radio :label="1">电性能</el-radio>
                        <el-radio :label="2">外观</el-radio>
                        <el-radio :label="3">电性能及外观</el-radio>
                    </el-radio-group>
                </el-form-item>
            </p>
            <!--电性能检验方式-->
            <el-form-item :label="nowLangue.electricTestWay" class="selectMB10" v-if="formInline.testProject==1||formInline.testProject==3">
                <el-select size="mini" clearable v-model="formInline.productLineId" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(product,index) in productLineList" :key="index" :label="product.label" :value="product.value"></el-option>
                </el-select>
            </el-form-item>
            <!--外观检验方式-->
            <el-form-item :label="nowLangue.appearanceTestWay" class="selectMB10" v-if="formInline.testProject==2||formInline.testProject==3">
                <el-select size="mini" clearable v-model="formInline.productLineId" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(product,index) in productLineList" :key="index" :label="product.label" :value="product.value"></el-option>
                </el-select>
            </el-form-item>
            <p>
                <!--检验数量-->
                <el-form-item :label="nowLangue.testCount" class="selectMB10">
                    <el-input size="mini" disabled v-model="formInline.materialName"></el-input>
                </el-form-item>
                <!--合格数量-->
                <el-form-item :label="nowLangue.qualifiedCount" class="selectMB10">
                    <el-input size="mini" disabled v-model="formInline.materialName"></el-input>
                </el-form-item>
                <!--不合格数量-->
                <el-form-item :label="nowLangue.unQualifiedCount" class="selectMB10">
                    <el-input size="mini" disabled v-model="formInline.materialName"></el-input>
                </el-form-item>
            </p>
            <!--备注-->
            <el-form-item :label="nowLangue.describetion" class="selectMB10 default-flex">
                <el-input size="mini" v-model="formInline.materialName" style="width:80%;"></el-input>
            </el-form-item>
            <!--检验条码-->
            <p class="radioLine">
                <el-form-item :label="nowLangue.barCodeType" class="selectMB10" style="color: rgb(44, 62, 80);font-weight:900;">
                    <el-radio-group v-model="formInline.barCodeType" style="color: rgb(61, 34, 31);font-weight:100;">
                        <el-radio :label="1">联想技服条码</el-radio>
                        <el-radio :label="2">供应商条码</el-radio>
                    </el-radio-group>
                </el-form-item>
            </p>
            <!--联想技服条码-->
            <p>
                <el-form-item :label="nowLangue.lenovoBarCode" class="selectMB10 default-flex" v-if="formInline.barCodeType==1">
                    <el-input type="textarea" resize="none" v-model="formInline.materialName" style="width:80%;"></el-input>
                </el-form-item>
            </p>
            <!--供应商条码-->
            <p>
                <el-form-item :label="nowLangue.supplierBarCode" class="selectMB10 default-flex">
                    <el-input type="textarea" resize="none" v-model="formInline.materialName" style="width:80%;"></el-input>
                </el-form-item>
            </p>
            <!--电性能检验结果-->
            <p class="radioLine">
                <el-form-item :label="nowLangue.electricTestResult" class="selectMB10">
                    <el-radio-group v-model="formInline.barCodeType">
                        <el-radio :label="true">合格</el-radio>
                        <el-radio :label="false">不合格</el-radio>
                    </el-radio-group>
                </el-form-item>
            </p>
            <!--外观检验结果-->
            <p class="radioLine">
                <el-form-item :label="nowLangue.appearanceTestResult" class="selectMB10">
                    <el-radio-group v-model="formInline.barCodeType">
                        <el-radio :label="true">合格</el-radio>
                        <el-radio :label="false">不合格</el-radio>
                    </el-radio-group>
                </el-form-item>
            </p>
            <!--处置意见-->
            <el-form-item :label="nowLangue.disposalOpinion" class="selectMB10">
                <el-select size="mini" clearable v-model="formInline.productLineId" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(product,index) in productLineList" :key="index" :label="product.label" :value="product.value"></el-option>
                </el-select>
            </el-form-item>
            <!--打印条码-->
            <el-form-item class="selectMB10">
                <el-button class="bolder outsideBtnBS selectAll" :disabled="selectDisabled" size="mini" type="danger" v-text="nowLangue.printBarCode"></el-button>
            </el-form-item>
            <!--批合格判定-->
            <p>
                <el-form-item :label="nowLangue.piQquailedJudge" class="selectMB10">
                    <el-select size="mini" clearable v-model="formInline.productLineId" :placeholder="nowLangue.pleaseSelect">
                        <el-option value="是"></el-option>
                        <el-option value="否"></el-option>
                    </el-select>
                </el-form-item>
            </p>
        </el-form>
        <label class="default-label" v-text="nowLangue.currentTestRecord"><!--本次检验记录--></label>
        <el-table :data="testSpareData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
            <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
            <!--备件编码-->
            <el-table-column prop="" :label="nowLangue.spareCode" header-align="center" show-overflow-tooltip></el-table-column>
            <!--备件名称-->
            <el-table-column prop="" :label="nowLangue.spareName" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--联想技服条码-->
            <el-table-column prop="" :label="nowLangue.lenovoBarCode" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--供应商条码-->
            <el-table-column prop="" :label="nowLangue.supplierBarCode" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--电性能检验-->
            <el-table-column prop="" :label="nowLangue.electricTest" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--电性能检验方式-->
            <el-table-column prop="" :label="nowLangue.electricTestWay" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--电性能检验结果-->
            <el-table-column prop="" :label="nowLangue.electricTestResult" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--外观检验-->
            <el-table-column prop="" :label="nowLangue.appearanceTest" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--外观检验方式-->
            <el-table-column prop="" :label="nowLangue.appearanceTestWay" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--外观检验结果-->
            <el-table-column prop="" :label="nowLangue.appearanceTestResult" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--处理意见-->
            <el-table-column prop="" :label="nowLangue.dealIdea" header-align="center" show-overflow-tooltip></el-table-column>
            <!--记录时间-->
            <el-table-column prop="" :label="nowLangue.recordTime" header-align="center" show-overflow-tooltip></el-table-column>
            <!--供应商名称-->
            <el-table-column prop="" :label="nowLangue.supplierName" header-align="center" show-overflow-tooltip></el-table-column>
        </el-table>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                nowLangue:{},
                languageScoped:{
                    zh:{
                        "JudgeTestRecord":"检验判定",
                        "confirm":"确定",
                        "spareCode":"备件编码",
                        "spareName":"备件名称",
                        "testProject":"检验项目",
                        "electricTestWay":"电性能检验方式",
                        "appearanceTestWay":"外观检验方式",
                        "pleaseSelect":"请选择",
                        "pleaseImport":"请输入",
                        "testCount":"检验数量",
                        "unQualifiedCount":"不合格数量",
                        "qualifiedCount":"合格数量",
                        "describetion":"备注",
                        "barCodeType":"检验条码",
                        "lenovoBarCode":"联想技服条码",
                        "supplierBarCode":"供应商条码",
                        "electricTestResult":"电性能检验结果",
                        "appearanceTestResult":"外观检验结果",
                        "disposalOpinion":"处置意见",
                        "printBarCode":"打印条码",
                        "piQquailedJudge":"批合格判定",
                        "currentTestRecord":"本次检验记录",
                        "recordTime":"记录时间",
                        "sequence":"序",
                        "dealIdea":"处理意见",
                        "supplierName":"供应商名称",
                        "electricTest":"电性能检验",
                        "appearanceTest":"外观检验"
                    },
                    en:{
                        "JudgeTestRecord":"JudgeTestRecord",
                        "confirm":"confirm",
                        "spareCode":"spareCode",
                        "spareName":"spareName",
                        "testProject":"testProject",
                        "electricTestWay":"electricTestWay",
                        "appearanceTestWay":"appearanceTestWay",
                        "pleaseSelect":"pleaseSelect",
                        "pleaseImport":"pleaseImport",
                        "testCount":"testCount",
                        "unQualifiedCount":"unQualifiedCount",
                        "qualifiedCount":"qualifiedCount",
                        "describetion":"describetion",
                        "barCodeType":"barCodeType",
                        "lenovoBarCode":"lenovoBarCode",
                        "supplierBarCode":"supplierBarCode",
                        "electricTestResult":"electricTestResult",
                        "appearanceTestResult":"appearanceTestResult",
                        "disposalOpinion":"disposalOpinion",
                        "printBarCode":"printBarCode",
                        "piQquailedJudge":"piQquailedJudge",
                        "currentTestRecord":"currentTestRecord",
                        "recordTime":"recordTime",
                        "sequence":"sequence",
                        "dealIdea":"dealIdea",
                        "supplierName":"supplierName",
                        "electricTest":"electricTest",
                        "appearanceTest":"appearanceTest"
                    }
                },
                // 查询表单
                formInline:{
                    testProject:1,
                    barCodeType:1,
                },
                //查询禁用
                selectDisabled:false,
            };
        },
        created:function(){
            this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
        },
        computed:{
            languageType(){
                return this.$store.state.languageType;
            }
        },
        watch:{
            languageType(){
                this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
            }
        },
        //进入页面立即运行此方法
        mounted: function () {
            var _this = this;
            _this.$store.commit('currentActive', 'CreateTestRecord');
            //ajax前后查询按钮禁用
            $(".selectAll").ajaxStart(function(){
                _this.selectDisabled=true;
            });
            $(".selectAll").ajaxStop(function(){
                _this.selectDisabled=false;
            });
        },
        methods:{

        }
    }
</script>



